feat: derive agent identity from a single private-key env var#435
Merged
manojbajaj95 merged 3 commits intoJun 16, 2026
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
When two processes with the same private key race to register, the loser gets a 409 from the identity server. Re-resolve the handle by DID and continue instead of failing startup. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Agent identity is now fully derivable from a single environment variable,
AUTHSOME_IDENTITY_PRIVATE_KEY. The DID is computed locally from the key, and the human-readable handle is resolved from the identity server by DID. This removes the need forAUTHSOME_IDENTITY, local identity files, orauthsome initin headless/agent deployments.Key changes:
RuntimeIdentity.load()accepts a key-only env and defers the handle (the runtimehandleis now optional and resolved later instead of raisingValueError).GET /api/identities/by-did/{did}route +IdentityRegistry.resolve_by_did().AUTHSOME_IDENTITYis kept as an optional, deprecated handle override for backward compatibility.Motivation and Context
The previous two-variable setup (
AUTHSOME_IDENTITY+AUTHSOME_IDENTITY_PRIVATE_KEY) plus local filesystem bootstrap was unnecessarily convoluted for CI, containers, and ephemeral agents. This aligns with the cryptographic model: the identity is the key pair, and the handle is server-registered metadata that should be resolved from the identity server rather than supplied locally.Closes #426.
How Has This Been Tested?
IdentityRegistry.resolve_by_did()returns the registered handle /Nonefor unknown DIDs.GET /api/identities/by-did/{did}returns the handle or 404.RuntimeIdentity.load()with a key-only env derives the DID and leaves the handle unresolved.AUTHSOME_IDENTITY" error.ruffandtyclean on all changed files.Types of changes
Checklist: